﻿
using System.Text.Json.Serialization;

namespace ORS.OrderRobot.ServiceContracts.Dtos.Api;
/// <summary>
/// 用户购物车响应数据
/// </summary>
public class BasketResDto
{
	[JsonPropertyName("baskets")]
	public List<BasketDto> Baskets { get; set; } = new List<BasketDto>();

	[JsonPropertyName("total")]
	public int Total { get; set; }
}

public class BasketDto
{

	[JsonPropertyName("basket_id")]
	public string BasketId { get; set; }

	[JsonPropertyName("currency")]
	public string Currency { get; set; }


	[JsonPropertyName("order_total")]
	public decimal? OrderTotal { get; set; }


	[JsonPropertyName("product_total")]
	public decimal? ProductTotal { get; set; }
	/// <summary>
	/// 如果购物车没有商品，不会返回该字段
	/// </summary>
    [JsonPropertyName("product_items")]
    public List<BasketProduct>? ProductItems { get; set; }
    /// <summary>
    /// 用户信息
    /// </summary>
    public BasketCustomerInfo? customer_info { get; set; }
	/// <summary>
	///  航班信息
	/// </summary>
	public string c_flightDetails { get; set; }
	/// <summary>
	/// 支付信息
	/// </summary>
	public List<BasketPaymentInstruments>? payment_instruments { get; set; }
	/// <summary>
	/// 收货信息
	/// </summary>
	public List<BasketShipments>? shipments { get; set; }
	/// <summary>
	/// 账单地址
	/// </summary>
	public BasketBillingAddress? billing_address { get; set; }
}

public class BasketProduct
{
	/// <summary>
	/// 购物车项目id
	/// </summary>
	public string item_id { get; set; }
	/// <summary>
	/// 商品id
	/// </summary>
	public string product_id { get; set; }
	/// <summary>
	/// 数量
	/// </summary>
	public int quantity { get; set; } = 1;

	public bool? gift { get; set; }
}

public class BasketCustomerInfo
{
    public string customer_id { get; set; }
	public string customer_no { get; set; }
	/// <summary>
	/// 当是空字符串时，提交订单会失败
	/// </summary>
    public string email { get; set; }
}

public class BasketPaymentInstruments
{
	public string payment_instrument_id { get; set; }

	public string payment_method_id { get; set; }
}

public class BasketShipments
{
	public BasketShipmentAddress? shipping_address { get; set; }

	public BasketShipmentMethod? shipping_method { get; set; }
}

public class BasketShipmentAddress
{
	public string first_name { get; set; }
}

public class BasketShipmentMethod
{
	public string id { get; set; }
}

public class BasketBillingAddress
{
	public string country_code { get; set; }
}